package form.ui.core {
	import flash.display.DisplayObject;
	import flash.events.Event;
	
	public class Stack extends Container {
		public function Stack() {
			super();
			if(labelField && contains(labelField)) 
			{
				removeChild(labelField);
			}
		}
		
		protected override function position():void {
			var numChildren:int = this.numChildren;
			var width:int = 0;
			var height:int = 0;
			
			for (var i:int = 0; i < numChildren; i++) {
				var child:DisplayObject = this.getChildAt(i);
				
				child.x = 0;
				child.y = height;
				
				if (width < child.width) {
					width = child.width;
				}
				height += child.height;
			}
			
			this.dimensions = [width, height];
		}
		
	}
}